using System.ComponentModel.DataAnnotations;

namespace Rabbit3.Api.Dto
{
    /// <summary>
    /// 养殖信息创建DTO
    /// </summary>
    public class CreateFarmingDto
    {
        /// <summary>
        /// 溯源信息ID
        /// </summary>
        [Required(ErrorMessage = "溯源信息ID不能为空")]
        public int TraceabilityId { get; set; }

        /// <summary>
        /// 品种
        /// </summary>
        [Required(ErrorMessage = "品种不能为空")]
        [StringLength(30, ErrorMessage = "品种长度不能超过30个字符")]
        public string Breed { get; set; } = string.Empty;

        /// <summary>
        /// 来源
        /// </summary>
        [Required(ErrorMessage = "来源不能为空")]
        [StringLength(30, ErrorMessage = "来源长度不能超过30个字符")]
        public string Source { get; set; } = string.Empty;

        /// <summary>
        /// 饲养天数
        /// </summary>
        [Required(ErrorMessage = "饲养天数不能为空")]
        [Range(1, 99999, ErrorMessage = "饲养天数必须在1-99999之间")]
        public int FarmingDays { get; set; }

        /// <summary>
        /// 饲料品牌
        /// </summary>
        [Required(ErrorMessage = "饲料品牌不能为空")]
        [StringLength(30, ErrorMessage = "饲料品牌长度不能超过30个字符")]
        public string FeedBrand { get; set; } = string.Empty;

        /// <summary>
        /// 饲养负责人
        /// </summary>
        [Required(ErrorMessage = "饲养负责人不能为空")]
        [StringLength(30, ErrorMessage = "饲养负责人长度不能超过30个字符")]
        public string FarmingManager { get; set; } = string.Empty;

        /// <summary>
        /// 出栏日期
        /// </summary>
        [Required(ErrorMessage = "出栏日期不能为空")]
        public DateTime ReleaseDate { get; set; }
    }

    /// <summary>
    /// 养殖信息更新DTO
    /// </summary>
    public class UpdateFarmingDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Required(ErrorMessage = "ID不能为空")]
        public int Id { get; set; }

        /// <summary>
        /// 品种
        /// </summary>
        [Required(ErrorMessage = "品种不能为空")]
        [StringLength(30, ErrorMessage = "品种长度不能超过30个字符")]
        public string Breed { get; set; } = string.Empty;

        /// <summary>
        /// 来源
        /// </summary>
        [Required(ErrorMessage = "来源不能为空")]
        [StringLength(30, ErrorMessage = "来源长度不能超过30个字符")]
        public string Source { get; set; } = string.Empty;

        /// <summary>
        /// 饲养天数
        /// </summary>
        [Required(ErrorMessage = "饲养天数不能为空")]
        [Range(1, 99999, ErrorMessage = "饲养天数必须在1-99999之间")]
        public int FarmingDays { get; set; }

        /// <summary>
        /// 饲料品牌
        /// </summary>
        [Required(ErrorMessage = "饲料品牌不能为空")]
        [StringLength(30, ErrorMessage = "饲料品牌长度不能超过30个字符")]
        public string FeedBrand { get; set; } = string.Empty;

        /// <summary>
        /// 饲养负责人
        /// </summary>
        [Required(ErrorMessage = "饲养负责人不能为空")]
        [StringLength(30, ErrorMessage = "饲养负责人长度不能超过30个字符")]
        public string FarmingManager { get; set; } = string.Empty;

        /// <summary>
        /// 出栏日期
        /// </summary>
        [Required(ErrorMessage = "出栏日期不能为空")]
        public DateTime ReleaseDate { get; set; }
    }

    /// <summary>
    /// 养殖信息响应DTO
    /// </summary>
    public class FarmingResponseDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 溯源信息ID
        /// </summary>
        public int TraceabilityId { get; set; }

        /// <summary>
        /// 品种
        /// </summary>
        public string Breed { get; set; } = string.Empty;

        /// <summary>
        /// 来源
        /// </summary>
        public string Source { get; set; } = string.Empty;

        /// <summary>
        /// 饲养天数
        /// </summary>
        public int FarmingDays { get; set; }

        /// <summary>
        /// 饲料品牌
        /// </summary>
        public string FeedBrand { get; set; } = string.Empty;

        /// <summary>
        /// 饲养负责人
        /// </summary>
        public string FarmingManager { get; set; } = string.Empty;

        /// <summary>
        /// 出栏日期
        /// </summary>
        public DateTime ReleaseDate { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedAt { get; set; }

        /// <summary>
        /// 免疫信息列表
        /// </summary>
        public List<ImmunityResponseDto> ImmunityInfos { get; set; } = new List<ImmunityResponseDto>();

        /// <summary>
        /// 企业信息
        /// </summary>
        public EnterpriseResponseDto? EnterpriseInfo { get; set; }
    }

    /// <summary>
    /// 免疫信息创建DTO
    /// </summary>
    public class CreateImmunityDto
    {
        /// <summary>
        /// 养殖信息ID
        /// </summary>
        [Required(ErrorMessage = "养殖信息ID不能为空")]
        public int FarmingInfoId { get; set; }

        /// <summary>
        /// 饲养天数
        /// </summary>
        [Required(ErrorMessage = "饲养天数不能为空")]
        [Range(1, 99999, ErrorMessage = "饲养天数必须在1-99999之间")]
        public int FarmingDays { get; set; }

        /// <summary>
        /// 免疫方式
        /// </summary>
        [Required(ErrorMessage = "免疫方式不能为空")]
        [StringLength(50, ErrorMessage = "免疫方式长度不能超过50个字符")]
        public string ImmunityMethod { get; set; } = string.Empty;
    }

    /// <summary>
    /// 免疫信息更新DTO
    /// </summary>
    public class UpdateImmunityDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Required(ErrorMessage = "ID不能为空")]
        public int Id { get; set; }

        /// <summary>
        /// 饲养天数
        /// </summary>
        [Required(ErrorMessage = "饲养天数不能为空")]
        [Range(1, 99999, ErrorMessage = "饲养天数必须在1-99999之间")]
        public int FarmingDays { get; set; }

        /// <summary>
        /// 免疫方式
        /// </summary>
        [Required(ErrorMessage = "免疫方式不能为空")]
        [StringLength(50, ErrorMessage = "免疫方式长度不能超过50个字符")]
        public string ImmunityMethod { get; set; } = string.Empty;
    }

    /// <summary>
    /// 免疫信息响应DTO
    /// </summary>
    public class ImmunityResponseDto
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 养殖信息ID
        /// </summary>
        public int FarmingInfoId { get; set; }

        /// <summary>
        /// 饲养天数
        /// </summary>
        public int FarmingDays { get; set; }

        /// <summary>
        /// 免疫方式
        /// </summary>
        public string ImmunityMethod { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedAt { get; set; }
    }

}


